import request from "@/utils/request";

// 查询巡检计划列表
export function listPlan(query) {
  return request({
    url: "/ctnm-ly/plan/list",
    method: "get",
    params: query,
  });
}

// 查询巡检计划详细
export function getPlan(examinePlanId) {
  return request({
    url: "/ctnm-ly/plan/" + examinePlanId,
    method: "get",
  });
}

// 新增巡检计划
export function addPlan(data) {
  return request({
    url: "/ctnm-ly/plan",
    method: "post",
    data: data,
  });
}

// 修改巡检计划
export function updatePlan(data) {
  return request({
    url: "/ctnm-ly/plan",
    method: "put",
    data: data,
  });
}

// 删除巡检计划
export function delPlan(examinePlanId) {
  return request({
    url: "/ctnm-ly/plan/" + examinePlanId,
    method: "delete",
  });
}

// 根据巡检类型查询巡检区域
export function getAreaByTypeApi(type) {
  return request({
    url: "/ctnm-ly/plan/selectInspection/" + type,
    method: "get",
  });
}
